package com.ganmiao.resp;


import com.ganmiao.exception.AbstractBusinessException;

/**
 * @Author zero.yin
 * @Date 2022/7/22 3:29 PM
 * @Desc
 */
public class MobBaseRes {
    
    private int code;
    
    private String desc;

    public MobBaseRes()
    {
        this.code = ResponseCode.SUCCESS.getCode();
        this.desc = ResponseCode.SUCCESS.getDesc();
    }

    public MobBaseRes(ResponseCode responseCode) {
        this.code = responseCode.getCode();
        this.desc = responseCode.getDesc();
    }

    public MobBaseRes(AbstractBusinessException exception)
    {
        this.code = exception.getResponseCode();
        this.desc = exception.getMessage();
    }

    public MobBaseRes(Integer code, String msg) {
        this.code = ResponseCode.getByCode(code).getCode().intValue();
        this.desc = msg;
    }

    public MobBaseRes(Integer code, String msg ,Object object) {
        this.code = ResponseCode.getByCode(code).getCode().intValue();
        this.desc = msg;
    }

    public int getCode()
    {
        return code;
    }

    public void setCode(int code)
    {
        this.code = code;
    }

    public String getDesc()
    {
        return desc;
    }

    public void setDesc(String desc)
    {
        this.desc = desc;
    }
    
}
